package main

import (
	"fyne.io/fyne/v2"
	"image/color"

	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/canvas"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/layout"
)

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("网格布局")

	text1 := canvas.NewText("1", color.Black)
	text2 := canvas.NewText("2", color.Black)
	text3 := canvas.NewText("3", color.Black)
	text4 := canvas.NewText("4", color.Black)
	text5 := canvas.NewText("5", color.Black)
	text6 := canvas.NewText("6", color.Black)
	text7 := canvas.NewText("7", color.Black)
	text8 := canvas.NewText("8", color.Black)
	text9 := canvas.NewText("9", color.Black)
	text10 := canvas.NewText("10", color.Black)
	text11 := canvas.NewText("11", color.Black)
	text12 := canvas.NewText("12", color.Black)
	text13 := canvas.NewText("13", color.Black)
	text14 := canvas.NewText("14", color.Black)
	text15 := canvas.NewText("15", color.Black)
	text16 := canvas.NewText("16", color.Black)
	grid := container.New(layout.NewGridWrapLayout(fyne.NewSize(50, 50)),
		//grid := container.New(layout.NewGridLayout(2),
		text1,
		text2,
		text3,
		text4,
		text5,
		text6,
		text7,
		text8,
		text9,
		text10,
		text11,
		text12,
		text13,
		text14,
		text15,
		text16,
	)
	myWindow.SetContent(grid)
	myWindow.ShowAndRun()
}
